import { App } from 'vue'
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { createGuard } from './guard'
import basicRoutes from './modules/basic'

const router = createRouter({
  history: createWebHashHistory(),
  routes: basicRoutes as RouteRecordRaw[]
})

export function setupRouter (app: App) {
  app.use(router)
  createGuard(router)
}
